// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import Layout from './components/layout.vue'
import IndexPage from './pages/index.vue'
import MoviePage from './pages/movie/movie_list.vue'
import MovieDetailPage from './pages/movie/movie_detail.vue'
import BookPage from './pages/book/book_list.vue'
import BookDetailPage from './pages/book/book_detail.vue'
import TeaPage from './pages/tea/tea.vue'
import MusicPage from './pages/music/music.vue'
import MusicDetailPage from './pages/music/music_detail.vue'
import VueRouter from 'vue-router'
import VueResource from 'vue-resource'
import AwesomeSwiper from 'vue-awesome-swiper';
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-default/index.css'
Vue.use(AwesomeSwiper);
Vue.use(VueRouter);
Vue.use(VueResource);
Vue.use(ElementUI)

let router = new VueRouter({
  mode : 'history',
  routes: [
    {
      path: '/',
      redirect: '/index'
    },
    {
      path: '/index',
      component: IndexPage
    },
    {
      path: '/movie',
      component: MoviePage
    },
    {
      path: '/movie/detail/:id',
      component: MovieDetailPage
    },
    {
      path: '/book',
      component: BookPage
    },
    {
      path: '/book/detail/:id',
      component: BookDetailPage
    },
    {
      path: '/tea',
      component: TeaPage
    },
    {
      path: '/music',
      component: MusicPage
    },
    {
      path: '/music/detail/:id',
      component: MusicDetailPage
    }
  ]
})

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  template: '<Layout/>',
  components: { Layout }
})
